package com.blueocean_health.care.management.controller;

import com.blueocean_health.care.management.common.LocalManager;
import com.blueocean_health.care.management.domain.base.User;
import com.blueocean_health.care.management.em.LocalManagerType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.blueocean_health.care.management.domain.base.SysResult;
import com.blueocean_health.care.management.domain.dto.SelectNurseDto;
import com.blueocean_health.care.management.exception.OrderServiceException;
import com.blueocean_health.care.management.service.order_service_info.SelectNurseService;

/**
 * 订单中护工操作相关
 * @author meisanfeng
 */
@RestController
@RequestMapping(value = "/web/order/nurse", produces = MediaType.APPLICATION_JSON_VALUE)
public class SelectNurseController {
	
	@Autowired
	private SelectNurseService selectNurseService;
	
	/**
	 * 查找符合条件的护工列表
	 * @param selectNurseDto
	 * @return
	 * @throws OrderServiceException 
	 */
	@RequestMapping(value = "/query")
	public SysResult queryNurse(@RequestBody SelectNurseDto selectNurseDto) throws OrderServiceException{
		User courrentUser = LocalManager.getVal(LocalManagerType.USER_WEB);
		String hid =  courrentUser.getHospitalId();
		selectNurseDto.setHospital(hid);
		return selectNurseService.queryNurse(selectNurseDto);
	}
	
}
